/*
 * @Author: your name
 * @Date: 2021-12-08 15:10:27
 * @LastEditTime: 2021-12-08 17:04:41
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /vite_vue3_ts/mock/createProductionServer.ts
 */
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer';
import user from './user/user';
import router from './user/routers';
import workplace from './dashboard/workplace';
import menu from './system/menu';

// 遍历mock下的文件
// const modules = import.meta.globEager('./**/*.ts');

const mockModules: any[] = [...user, ...router, ...workplace, ...menu];
// const mockModules: any[] = [];
// Object.keys(modules).forEach(key => {
//   if (key.includes('/_')) {
//     return;
//   }
//   mockModules.push(...modules[key].default);
// });

export function setupProdMockServer() {
  createProdMockServer(mockModules);
}
